package com.poi.qianmi.conver;

import com.poi.qianmi.model.User;
import org.apache.poi.ss.usermodel.Row;

/**
 * @Classname UserConverter
 * @Description 用户转换类
 * @Date 2019/9/19 7:38 下午
 * @Created by xiaocai
 */
public class UserConver {

    public static User converterTosheet(Row row) {
        return User.builder()
                .name(row.getCell(0).getStringCellValue())
                .adress(row.getCell(1).getStringCellValue())
                .vip(row.getCell(2).getStringCellValue())
                .remark(row.getCell(3).getStringCellValue()).build();
    }

    public static User converterTosheet(String[] readRow) {
        return User.builder()
                .name(readRow[0])
                .adress(readRow[1])
                .vip(readRow[2])
                .remark(readRow[3]).build();


    }
}
